
package de.unihannover.se.restlab.microblog_client.models;

import java.util.Date;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementRef;
import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement(name = "user")
@XmlAccessorType(XmlAccessType.FIELD)
public class User {

	@XmlElement
	private Integer id;
	@XmlElement
	private String name;
	@XmlElement
	private Date createdAt;

	@XmlElementRef
	private Link self;

	public User () {
	}

	public User (Integer id, String name) {
		super();
		this.id = id;
		this.name = name;
		this.createdAt = new Date();
	}

	public Integer getId () {
		return id;
	}

	public String getName () {
		return name;
	}

	public void setName (String name) {
		this.name = name;
	}

	public Date getCreatedAt () {
		return createdAt;
	}

	public Link getSelf () {
		return self;
	}

	public void setSelf (Link self) {
		this.self = self;
	}

	public void setId (Integer id) {
		this.id = id;
	}

	public void setCreatedAt (Date createdAt) {
		this.createdAt = createdAt;
	}

	@Override
	public String toString () {
		return "User [id=" + id + ", name=" + name + ", createdAt=" + createdAt + "]";
	}
}
